package com.woniuxy.entitys;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.List;

/**
 * tb_hospital
 * @author 
 */
@Data
public class TbHospital implements Serializable {
    private TbHospitalManager manager;
    private Integer id;

    private String hname;

    private String province;

    private String city;

    private String country;

    private String district;

    private String account;

    private Long gain;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    private Integer softdel;

    private String beiyong1;

    private String beiyong2;
    private List<TbDepartment> tbDepartments;
    private TbDepartment department1;


    /*
        级联查询需要的属性
     */
    private String name;

    public TbHospitalManager getManager() {
        return manager;
    }

    public void setManager(TbHospitalManager manager) {
        this.manager = manager;
    }

    public List<TbDepartment> getTbDepartments() {
        return tbDepartments;
    }

    public void setTbDepartments(List<TbDepartment> tbDepartments) {
        this.tbDepartments = tbDepartments;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    private List<TbDepartment> departments = new ArrayList<>();
    private static final long serialVersionUID = 1L;

    public List<TbDepartment> getDepartments() {
        return departments;
    }

    public void setDepartments(List<TbDepartment> departments) {
        this.departments = departments;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getHname() {
        return hname;
    }

    public void setHname(String hname) {
        this.hname = hname;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public Long getGain() {
        return gain;
    }

    public void setGain(Long gain) {
        this.gain = gain;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getSoftdel() {
        return softdel;
    }

    public void setSoftdel(Integer softdel) {
        this.softdel = softdel;
    }

    public String getBeiyong1() {
        return beiyong1;
    }

    public void setBeiyong1(String beiyong1) {
        this.beiyong1 = beiyong1;
    }

    public String getBeiyong2() {
        return beiyong2;
    }

    public void setBeiyong2(String beiyong2) {
        this.beiyong2 = beiyong2;
    }

    @Override
    public String toString() {
        return "TbHospital{" +
                "id=" + id +
                ", hname='" + hname + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", country='" + country + '\'' +
                ", district='" + district + '\'' +
                ", account='" + account + '\'' +
                ", gain=" + gain +
                ", createTime=" + createTime +
                ", softdel=" + softdel +
                ", beiyong1='" + beiyong1 + '\'' +
                ", beiyong2='" + beiyong2 + '\'' +
                ", departments=" + departments +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbHospital that = (TbHospital) o;
        return Objects.equals(id, that.id) && Objects.equals(hname, that.hname) && Objects.equals(province, that.province) && Objects.equals(city, that.city) && Objects.equals(country, that.country) && Objects.equals(district, that.district) && Objects.equals(account, that.account) && Objects.equals(gain, that.gain) && Objects.equals(createTime, that.createTime) && Objects.equals(softdel, that.softdel) && Objects.equals(beiyong1, that.beiyong1) && Objects.equals(beiyong2, that.beiyong2) && Objects.equals(departments, that.departments);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, hname, province, city, country, district, account, gain, createTime, softdel, beiyong1, beiyong2, departments);
    }

}